<!doctype html>
<html>

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
  <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  <title>商城</title>
  <link rel="stylesheet" type="text/css" href="../css/api.css" />
  <link rel="stylesheet" type="text/css" href="../css/nearby.css" />
</head>

<body>
  <div id="app" v-cloak>
    <div class="wrap flex-wrap flex-vertical">
      <header id="header">
        <div class="header-wrap">
          <div @click="goback" class="header-left">
            <i class="iconfont icon-pre"></i>
          </div>
          <div class="header-title">商城</div>
        </div>
      </header>
      <div id="main" class="flex-con"></div>
    </div>
  </div>
</body>

</html>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/vue.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
<script type="text/javascript">
  var app;
  apiready = function () {
    $api.fixStatusBar($api.dom('#header'));
    app = new Vue({
      el: '#app',
      data: {},
      created: function () {
        var _this = this;
        api.addEventListener({
          name: 'keyback'
        }, function (ret, err) {
          api.historyBack({
            frameName: 'mall_frame'
          },function (ret, err) {
            if(!ret.status){
              api.closeWin();
            }
          });
        });
      },
      mounted: function () {
        var _this = this;
        _this.openMallFrame();
      },
      methods: {
        goback: function () {
          api.closeWin();
        },

        openMallFrame: function () {
          var _this = this;
          api.openFrame({
            name: 'mall_frame',
            url: 'http://122.51.160.250:83/mobile/index?uid=' + $api.getStorage('uid'),
            rect: {
              x: 0,
              y: $api.dom('#header').offsetHeight,
              w: api.winWidth,
              h: $api.dom('#main').offsetHeight,
            },
            vScrollBarEnabled: false,
            hScrollBarEnabled: false,
          });
        },

      },
    })
  }
</script>